<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/4/23
  Time: 11:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta property="lang" content="zh_CN">
    <title>言曌博客 | 文章编辑</title>
    <link rel="shortcut icon" type="images/x-icon" href="/upload/2018/10/logo20181111185335360.png">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/font-awesome.min.css">
    <link rel="stylesheet" href="css/pace.min.css">
    <link rel="stylesheet" href="css/adminlte.min.css">
    <link rel="stylesheet" href="css/_all-skins.min.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/loader.css">
    <link rel="stylesheet" href="css/jquery.toast.min.css">
    <link rel="stylesheet" href="css/fileinput.min.css">
    <link rel="stylesheet" href="css/owo.min.css">
    <link rel="stylesheet" href="css/pretty-checkbox.min.css">
    <!--[if lt IE 9]>
    <script src="js/html5shiv.min.js"></script>
    <script src="js/respond.min.js"></script>
    <![endif]-->
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/owo.min.js"></script>
</head>
<body class="hold-transition sidebar-mini fixed skin-blue ">
<div class="wrapper">
    <!-- 顶部栏模块 -->
    <header class="main-header">
        <a href="/admin" class="logo">
            <span class="logo-mini"><b>S</b>S</span>
            <span class="logo-lg"><b>SE</b>NS</span>
        </a>
        <nav class="navbar navbar-static-top" role="navigation">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li><a href="/" title="跳转到前台" target="_blank"><i class="fa fa-location-arrow"></i></a></li>
                    <li class="dropdown messages-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <i class="fa fa-bell-o"></i>
                        </a>
                        <ul class="dropdown-menu">
                            <li class="header">
                                你有 0 条新评论
                            </li>
                            <li>
                                <ul class="menu">
                                </ul>
                            </li>
                            <li class="footer"><a href="/admin/comment?status=1">查看所有评论</a></li>
                        </ul>
                    </li>
                    <li class="dropdown user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <img src="picture/1927d92e4aa543c8a2c764b6d096c335.gif" class="user-image" alt="User Image">
                            <span class="hidden-xs">xhz199838</span>
                        </a>
                        <ul class="dropdown-menu">
                            <li class="user-header">
                                <img src="picture/1927d92e4aa543c8a2c764b6d096c335.gif" class="img-circle"
                                     alt="User Image">
                                <p>xhz199838</p>
                            </li>
                            <li class="user-footer">
                                <div class="pull-left"><a data-pjax="true" href="/admin/user/profile"
                                                          class="btn btn-default "><i class="fa fa-user"></i>个人资料</a>
                                </div>
                                <div class="pull-right"><a href="/admin/logOut" class="btn btn-default "><i
                                        class="fa fa-sign-out"></i>退出登录</a></div>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
    <!-- 菜单栏模块 -->
    <aside class="main-sidebar">
        <section class="sidebar">
            <div class="user-panel">
                <div class="pull-left image">
                    <img src="picture/1927d92e4aa543c8a2c764b6d096c335.gif" class="img-circle"
                         style="width: 45px;height: 45px;" alt="User Image">
                </div>
                <div class="pull-left info">
                    <p>xhz199838</p>
                    <a href="/admin/user/profile"><i
                            class="fa fa-circle text-success"></i>个人资料</a>
                </div>
            </div>
            <form action="/search" method="get" target="_blank" class="sidebar-form">
                <div class="input-group">
                    <input type="text" name="keyword" class="form-control" placeholder="Search...">
                    <span class="input-group-btn">
<button type="submit" name="keyword" id="search-btn" target="_blank" class="btn btn-flat">
<i class="fa fa-search"></i>
</button>
</span>
                </div>
            </form>
            <!--左侧菜单栏-->
            <ul class="sidebar-menu tree" data-widget="tree">
                <li class="header">HEADER</li>
                <li class="active"><a data-pjax="true" href="index.jsp"> <i class="fa fa-dashboard"></i> <span>仪表盘</span>
                </a></li>
                <li class="treeview"><a data-pjax="true" href="#"> <i class="fa fa-book"></i> <span>文章</span> <span
                        class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span> </a>
                    <ul class="treeview-menu">
                        <li><a data-pjax="true" href="post.jsp"> <i class="fa fa-circle-o"></i>所有文章 </a></li>
                        <li><a data-pjax="true" href="postnew.jsp"> <i class="fa fa-circle-o"></i>写文章 </a></li>
                        <li><a data-pjax="true" href="category.jsp"> <i class="fa fa-circle-o"></i>分类目录 </a></li>
                        <li><a data-pjax="true" href="tag.jsp"> <i class="fa fa-circle-o"></i>标签 </a></li>
                    </ul>
                </li>
                <li><a data-pjax="true" href="attachment.jsp"> <i class="fa fa-picture-o"></i> <span>附件</span> </a>
                </li>
                <li><a data-pjax="true" href="comment.jsp"> <i class="fa fa-comment"></i> <span>评论</span> </a></li>
                <li class="treeview"><a data-pjax="true" href="#"> <i class="fa fa-user-o"></i> <span>用户</span> <span
                        class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span> </a>
                    <ul class="treeview-menu">
                        <li><a data-pjax="true" href="userprofile.jsp"> <i class="fa fa-circle-o"></i>个人资料 </a></li>
                    </ul>
                </li>
            </ul>
        </section>
    </aside>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <link rel="stylesheet"
              href="css/froala_editor.pkgd.min.css">
        <link rel="stylesheet"
              href="css/froala_style.min.css">
        <link rel="stylesheet"
              href="css/jquery.tag-editor.css">
        <link rel="stylesheet" href="css/highlight.css">
        <style type="text/css">
            #post_title {
                font-weight: 400;
            }

            #btnOpenAttach {
                margin-left: 4px;
                padding: 3px 6px;
                position: relative;
                top: -4px;
                border: 1px solid #ccc;
                border-radius: 2px;
                background: #fff;
                text-shadow: none;
                font-weight: 600;
                font-size: 12px;
                line-height: normal;
                color: #3c8dbc;
                cursor: pointer;
                transition: all .2s ease-in-out
            }

            #btnOpenAttach:hover {
                background: #3c8dbc;
                color: #fff
            }

            .form-horizontal .control-label {
                text-align: left;
            }

            .editor-preview-active img, .editor-preview-active-side img {
                width: 100%;
            }

            .fr-toolbar {
                border-top: 1px solid #ccc !important;
            }

            .fr-wrapper > div[style*='z-index: 9999'] {
                position: absolute;
                top: -10000px;
                opacity: 0;
                height: 0;
            }
        </style>
        <section class="content-header">
            <h1 style="display: inline-block;">文章编辑</h1>
            <a id="btnOpenAttach" href="#" onclick="openAttachCopy()">
                附件库 </a>
            <ol class="breadcrumb">
                <li>
                    <a data-pjax="true" href="#"><i
                            class="fa fa-dashboard"></i> 首页</a>
                </li>
                <li>
                    <a data-pjax="true" href="/admin/post">文章管理</a>
                </li>
                <li class="active">文章编辑</li>
            </ol>
        </section>
        <section class="content">
            <div class="row">
                <div class="col-md-9">
                    <input type="hidden" id="postId" name="postId" value="">
                    <input type="hidden" id="status" name="status" value="">
                    <div>
                        <input type="text" class="form-control input-lg" id="post_title" name="post_title"
                               placeholder="请输入文章标题"
                               onblur="autoComplateUrl();" value="">
                    </div>
                    <div style="display: block;margin-bottom: 10px;">
<span>
固定链接: <a href="#">http://blog.liuyanzhao.com/article/<span id="postUrl"></span>/
</a>
<button class="btn btn-default btn-sm "
        id="btn_input_postUrl">编辑</button>
<button class="btn btn-default btn-sm " id="btn_change_postUrl" onclick="urlOnBlurAuto()"
        style="display: none;">确定</button>
</span>
                    </div>
                    <div class="box box-primary no-border">
                        <div class="box-body no-padding">
                            <div id='edit'></div>
                        </div>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">发布</h3>
                            <div class="box-tools">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse"
                                        data-toggle="tooltip"
                                        title="Collapse">
                                    <i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="box-body">
                            <form class="form-horizontal">
                                <div class="form-group">
                                    <label for="postSource"
                                           class="control-label col-md-4">文章类型</label>
                                    <div class="col-md-8">
                                        <select class="form-control" id="postSource" name="postSource">
                                            <option value="1"
                                            >原创
                                            </option>
                                            <option value="2"
                                            >转载
                                            </option>
                                            <option value="3"
                                            >翻译
                                            </option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="allowComment"
                                           class="control-label col-md-4">开启评论</label>
                                    <div class="col-md-8">
                                        <select class="form-control" id="allowComment" name="allowComment">
                                            <option value="1"
                                            >是
                                            </option>
                                            <option value="0"
                                            >否
                                            </option>
                                        </select>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="box-footer">
                            <button onclick="push(1)"
                                    class="btn btn-default btn-sm ">保存草稿
                            </button>
                            <button onclick="push(0)" class="btn btn-primary btn-sm pull-right "
                                    data-loading-text="发布中...">
                                发布
                            </button>
                        </div>
                    </div>
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">分类目录</h3>
                            <div class="box-tools">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse" title="Collapse">
                                    <i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="box-body" style="display: block;max-height: 300px;overflow: auto;">
                            <div class="form-group">
                                <ul class="post-cate-ul">
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level1">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="1">
                                            <div class="state p-primary">
                                                <label>未分类</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level1">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="138">
                                            <div class="state p-primary">
                                                <label>Java 开发</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="109">
                                            <div class="state p-primary">
                                                <label>Java 基础</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="155">
                                            <div class="state p-primary">
                                                <label>JavaWeb</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="230">
                                            <div class="state p-primary">
                                                <label>模板引擎</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="193">
                                            <div class="state p-primary">
                                                <label>java 进阶</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="229">
                                            <div class="state p-primary">
                                                <label>Java 源码</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="242">
                                            <div class="state p-primary">
                                                <label>多线程并发编程</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="213">
                                            <div class="state p-primary">
                                                <label>备战面试</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="243">
                                            <div class="state p-primary">
                                                <label>工具类</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="245">
                                            <div class="state p-primary">
                                                <label>技术架构</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level1">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="198">
                                            <div class="state p-primary">
                                                <label>计算机科学</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="200">
                                            <div class="state p-primary">
                                                <label>数据结构和算法</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="201">
                                            <div class="state p-primary">
                                                <label>操作系统</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="202">
                                            <div class="state p-primary">
                                                <label>数据库</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="203">
                                            <div class="state p-primary">
                                                <label>计算机网络</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="246">
                                            <div class="state p-primary">
                                                <label>编译原理</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level1">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="236">
                                            <div class="state p-primary">
                                                <label>其他技术</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="3">
                                            <div class="state p-primary">
                                                <label>HTML/CSS</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="4">
                                            <div class="state p-primary">
                                                <label>JavaScript/jQuery</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="63">
                                            <div class="state p-primary">
                                                <label>PHP</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="85">
                                            <div class="state p-primary">
                                                <label>网站建设</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="16">
                                            <div class="state p-primary">
                                                <label>Apache/Nginx</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="15">
                                            <div class="state p-primary">
                                                <label>Linux</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="10">
                                            <div class="state p-primary">
                                                <label>WordPress</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="86">
                                            <div class="state p-primary">
                                                <label>服务器与主机</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="89">
                                            <div class="state p-primary">
                                                <label>网站优化</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="237">
                                            <div class="state p-primary">
                                                <label>C</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="241">
                                            <div class="state p-primary">
                                                <label>前端组件</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level1">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="275">
                                            <div class="state p-primary">
                                                <label>框架与实战</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="24">
                                            <div class="state p-primary">
                                                <label>异常与报错</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="65">
                                            <div class="state p-primary">
                                                <label>开发利器</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="179">
                                            <div class="state p-primary">
                                                <label>Spring 家族</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="250">
                                            <div class="state p-primary">
                                                <label>SpringBoot教程</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="251">
                                            <div class="state p-primary">
                                                <label>SpringCloud</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="228">
                                            <div class="state p-primary">
                                                <label>ORM 框架</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="232">
                                            <div class="state p-primary">
                                                <label>搜索引擎框架</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="233">
                                            <div class="state p-primary">
                                                <label>缓存技术</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="244">
                                            <div class="state p-primary">
                                                <label>第三方依赖</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="271">
                                            <div class="state p-primary">
                                                <label>微服务和分布式</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="284">
                                            <div class="state p-primary">
                                                <label>安全框架</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="285">
                                            <div class="state p-primary">
                                                <label>Shiro</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level3">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="286">
                                            <div class="state p-primary">
                                                <label>Spring Security</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level1">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="276">
                                            <div class="state p-primary">
                                                <label>资源与知识</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="13">
                                            <div class="state p-primary">
                                                <label>视频收藏</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="23">
                                            <div class="state p-primary">
                                                <label>文章杂烩</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="59">
                                            <div class="state p-primary">
                                                <label>资源分享</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="110">
                                            <div class="state p-primary">
                                                <label>上网百科</label>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="post-cate-li">
                                        <div class="pretty p-default level2">
                                            <input name="categories" id="categories" type="checkbox" class="minimal"
                                                   value="182">
                                            <div class="state p-primary">
                                                <label>娱乐游戏</label>
                                            </div>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="box-footer"></div>
                    </div>
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">标签</h3>
                            <div class="box-tools">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse" title="Collapse">
                                    <i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="box-body">
                            <input type="text" class="form-control input-lg" id="tagList" name=""/><br>
                            <select class="form-control" id="chooseTag" name="chooseTag">
                                <option value="">选择添加</option>
                                <option value="Java">Java</option>
                                <option value="故障">故障</option>
                                <option value="WordPress">WordPress</option>
                                <option value="SpringBoot">SpringBoot</option>
                                <option value="JS">JS</option>
                                <option value="美文">美文</option>
                                <option value="计算机网络">计算机网络</option>
                                <option value="视频">视频</option>
                                <option value="HTML/CSS">HTML/CSS</option>
                                <option value="Mybatis">Mybatis</option>
                                <option value="JSP">JSP</option>
                                <option value="多线程">多线程</option>
                                <option value="MySQL">MySQL</option>
                                <option value="Eclipse">Eclipse</option>
                                <option value="SpringMVC">SpringMVC</option>
                                <option value="PHP">PHP</option>
                                <option value="Spring">Spring</option>
                                <option value="插件">插件</option>
                                <option value="服务器">服务器</option>
                                <option value="C">C</option>
                                <option value="IDEA">IDEA</option>
                                <option value="面试">面试</option>
                                <option value="算法">算法</option>
                                <option value="Linux">Linux</option>
                                <option value="Redis">Redis</option>
                                <option value="JPA">JPA</option>
                                <option value="知更鸟主题">知更鸟主题</option>
                                <option value="ThinkPHP">ThinkPHP</option>
                                <option value="Mac">Mac</option>
                                <option value="软件">软件</option>
                                <option value="他山之石">他山之石</option>
                                <option value="SSM">SSM</option>
                                <option value="GUI">GUI</option>
                                <option value="Maven">Maven</option>
                                <option value="习题">习题</option>
                                <option value="数据结构">数据结构</option>
                                <option value="Spring Security">Spring Security</option>
                                <option value="七牛">七牛</option>
                                <option value="Hibernate">Hibernate</option>
                                <option value="数据库">数据库</option>
                                <option value="JDBC">JDBC</option>
                                <option value="Servlet">Servlet</option>
                                <option value="elasticsearch">elasticsearch</option>
                                <option value="shiro">shiro</option>
                                <option value="游戏">游戏</option>
                                <option value="SpringCloud">SpringCloud</option>
                                <option value="操作系统">操作系统</option>
                                <option value="反射">反射</option>
                                <option value="Thymeleaf">Thymeleaf</option>
                                <option value="Docker">Docker</option>
                                <option value="说说">说说</option>
                                <option value="Gravatar">Gravatar</option>
                                <option value="Socket">Socket</option>
                                <option value="FreeMarker">FreeMarker</option>
                                <option value="Nginx">Nginx</option>
                                <option value="爱国">爱国</option>
                                <option value="设计模式">设计模式</option>
                                <option value="EDAS">EDAS</option>
                                <option value="测试">测试</option>
                                <option value="Struts2">Struts2</option>
                                <option value="jenkins">jenkins</option>
                                <option value="阿里云">阿里云</option>
                                <option value="膨胀">膨胀</option>
                                <option value="设计">设计</option>
                                <option value="mongodb">mongodb</option>
                                <option value="音乐">音乐</option>
                                <option value="计算机网络3">计算机网络3</option>
                            </select>
                        </div>
                    </div>
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">缩略图</h3>
                            <div class="box-tools">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse"
                                        data-toggle="tooltip"
                                        title="Collapse">
                                    <i class="fa fa-minus"></i>
                                </button>
                            </div>
                        </div>
                        <div class="box-body">
                            <div>
                                <img src="picture/thumbnail.png" class="img-responsive img-thumbnail"
                                     id="selectImg" onclick="openAttach('selectImg')" style="cursor: pointer;">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <script>
            /**
             * 打开附件
             */
            function openAttach(e) {
                layer.open({
                    type: 2,
                    title: '所有附件',
                    shadeClose: true,
                    shade: 0.5,
                    maxmin: true,
                    area: ['90%', '90%'],
                    content: '/admin/attachment/select?id=' + e,
                    scrollbar: false
                });
            }

            function openAttachCopy() {
                layer.open({
                    type: 2,
                    title: '所有附件',
                    shadeClose: true,
                    shade: 0.5,
                    maxmin: true,
                    area: ['90%', '90%'],
                    content: '/admin/attachment/select?type=post',
                    scrollbar: false
                });
            }

            /**
             * 自动填充路径，并且将汉字转化成拼音以-隔开
             */
            function autoComplateUrl() {
                var titleVal = $("#post_title").val();
                if (titleVal != "" && titleVal != null && $("#postUrl").html() == '') {
                    var result = $("#post_title").toPinyin().toLowerCase();
                    $("#postUrl").html(result.substring(0, result.length));
                }
            }

            /**
             * 检测是否已经存在该链接
             * @constructor
             */
            function urlOnBlurAuto() {
                if ($('#newPostUrl').val() === "") {
                    showMsg("固定链接不能为空！", "info", 2000);
                    return;
                }
                $.ajax({
                    type: 'GET',
                    url: '/admin/post/checkUrl',
                    async: false,
                    data: {
                        'postUrl': $('#newPostUrl').val()
                    },
                    success: function (data) {
                        if (data.code == 0) {
                            showMsg(data.msg, "error", 2000);
                            return;
                        } else {
                            $('#postUrl').html($('#newPostUrl').val());
                            $('#btn_change_postUrl').hide();
                            $('#btn_input_postUrl').show();
                        }
                    }
                });
            }

            $('#btn_input_postUrl').click(function () {
                var postUrl = $("#postUrl").html();
                $('#postUrl').html("<input type='text' id='newPostUrl' onblur='urlOnBlurAuto()' value='" + postUrl + "'>");
                $(this).hide();
                $('#btn_change_postUrl').show();
            });
            var postTitle = $("#post_title");

            /**
             * 提交文章
             * @param status 文章状态
             */
            function push(status) {
                var Title = "";
                if (postTitle.val()) {
                    Title = postTitle.val();
                } else {
                    showMsg("标题不能为空！", "info", 2000);
                    return;
                }
                var cateList = new Array();
                $('input[name="categories"]:checked').each(function () {
                    cateList.push($(this).val());
                });
                if ($('#postUrl').html() === "") {
                    showMsg("固定链接不能为空！", "info", 2000);
                    return;
                }
                $.ajax({
                    type: 'POST',
                    url: '/admin/post/new/push',
                    async: false,
                    data: {
                        'postId': $('#postId').val(),
                        'postStatus': status,
                        'postTitle': Title,
                        'postUrl': $('#postUrl').html().toString(),
                        'postContent': $("#edit").froalaEditor('html.get'),
                        'postThumbnail': $('#selectImg').attr('src'),
                        'cateList': cateList.toString(),
                        'tagList': $('#tagList').tagEditor('getTags')[0].tags.toString(),
                        'postSource': $('#postSource').val(),
                        'allowComment': $('#allowComment').val()
                    },
                    success: function (data) {
                        if (data.code == 1) {
//清除自动保存的内容
                            $.toast({
                                text: data.msg,
                                heading: '提示',
                                icon: 'success',
                                showHideTransition: 'fade',
                                allowToastClose: true,
                                hideAfter: 1000,
                                stack: 1,
                                position: 'top-center',
                                textAlign: 'left',
                                loader: true,
                                loaderBg: '#ffffff',
                                afterHidden: function () {
                                    window.location.href = "/admin/post";
                                }
                            });
                        } else {
                            $.toast({
                                text: data.msg,
                                heading: '提示',
                                icon: 'error',
                                showHideTransition: 'fade',
                                allowToastClose: true,
                                hideAfter: 1000,
                                stack: 1,
                                position: 'top-center',
                                textAlign: 'left',
                                loader: true,
                                loaderBg: '#ffffff'
                            });
                        }
                    }
                });
            }

            // setInterval("autoPush()", "60000");
            /**
             * 自动保存文章
             */
            function autoPush() {
                var Title = "";
                if (postTitle.val()) {
                    Title = postTitle.val();
                }
                var cateList = new Array();
                $('input[name="categories"]:checked').each(function () {
                    cateList.push($(this).val());
                });
                $.ajax({
                    type: 'POST',
                    url: '/admin/post/new/autoPush',
                    async: false,
                    data: {
                        'postId': $('#postId').val(),
                        'postStatus': $('#status').val(),
                        'postTitle': Title,
                        'postUrl': $('#postUrl').html().toString(),
                        'postContent': $("#edit").froalaEditor('html.get'),
                        'postThumbnail': $('#selectImg').attr('src'),
                        'cateList': cateList.toString(),
                        'tagList': $('#tagList').tagEditor('getTags')[0].tags.toString(),
                        'postSource': $('#postSource').val(),
                        'allowComment': $('#allowComment').val()
                    },
                    success: function (data) {
                        if (!$("#post_title").val()) {
                            $("#post_title").val(data.result.postTitle);
                        }
                        if (!$("#postId").val()) {
                            $("#postId").val(data.result.postId);
                        }
                        if ($("#postUrl").html() == '') {
                            $("#postUrl").html(data.result.postUrl);
                        }
                    }
                });
            }

            /**
             * Ctrl+C保存
             */
            $(document).keydown(function (event) {
                if (event.ctrlKey && event.keyCode === 83) {
                    autoPush();
                }
            });
            //页面加载完成后再执行
            $(function () {
                $('#edit').froalaEditor({
                    heightMin: 750,
                    heightMax: 1000,
                    placeholderText: '',
                    pastePlain: true,
                    theme: 'gray',
                    fontFamilySelection: true,
                    fontSizeSelection: true,
                    paragraphFormatSelection: true,
                    toolbarButtons: ['paragraphFormat', 'bold', 'italic', 'underline', 'strikeThrough', 'quote', 'insertLink', 'emoticons', 'insertImage', 'insertVideo', 'embedly', 'insertFile', 'insertTable',
                        'align', 'formatOL', 'formatUL', 'fullscreen', '-', 'fontFamily', 'fontSize', 'color', 'outdent', 'indent', 'specialCharacters', 'insertHR', 'clearFormatting',
                        'print', 'spellChecker', 'undo', 'redo', 'help', 'html',],
                    imageAllowedTypes: ['jpg', 'gif', 'png', 'jpeg', 'svg', 'psd'],
                    imageDefaultWidth: 100,
                    imageInsertButtons: ['imageBack', '|', 'imageUpload', 'imageByURL'],
                    imageUploadURL: '/admin/attachment/upload/froala',
                    imageManagerLoadURL: '/admin/attachment/froala',
                    imageManagerLoadMethod: "GET",
                    imageManagerPageSize: 4,
                    imageManagerScrollOffset: 20,
                    fileUploadURL: '/admin/attachment/upload/froala',
                    videoUploadURL: '/admin/attachment/upload/froala',
                    imagePaste: true,
                    imageMove: true,
                    pastePlain: true,
                    toolbarStickyOffset: 50,
                    tableResizer: true
                    , language: 'zh_cn'
                })
                /**
                 * 初始化标签
                 */
                $('#tagList').tagEditor({
//initialTags: ['Hello', 'World', 'Example', 'Tags'],
                    delimiter: ',',
                    placeholder: '请输入标签',
                    forceLowercase: false
                });
                /**
                 * 加载该文章已有的标签
                 */
                $('#chooseTag').change(function () {
                    $('#tagList').tagEditor('addTag', $(this).val());
                });
            });
        </script>
    </div>
    <footer class="main-footer">
        <div class="pull-right hidden-xs"><a target="_blank" href="#">1.0.0</a></div>
        Thanks for using <strong><a data-pjax="true" href="/admin/sens">SENS</a>.</strong>
    </footer>
</div>
<script src="js/jquery.pjax.js"></script>
<script src="js/pace.min.js"></script>
<script src="js/adminlte.min.js"></script>
<script src="js/jquery.toast.min.js"></script>
<script src="js/layer.js"></script>
<script src="js/fileinput.min.js"></script>
<script src="js/froala_editor.pkgd.min.js"></script>
<script src="js/zh_cn.js"></script>
<script src="js/image_manager.min.js"></script>
<script src="js/codemirror-4.inline-attachment.min.js"></script>
<script src="js/jquery.tag-editor.min.js"></script>
<script src="js/jquery.caret.min.js"></script>
<script src="js/jquery.hz2py-min.js"></script>
<script src="js/zh.min.js"></script>
<script src="js/app.js"></script>
<script> Pace.options = {restartOnRequestAfter: false};
$(document).ajaxStart(function () {
    Pace.restart();
});
$(document).pjax('a[data-pjax=true]', '.content-wrapper', {fragment: '.content-wrapper', timeout: 8000});
var heading = "提示"; </script>
</body>
</html>
